Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the "AMOUNT" argument for jj prev and jj next to OFFSET #3443

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

emesterhazy
Copy link
Contributor

Offset is a more descriptive noun for this argument. This commit also tweaks the help message for the argument.

This isn't an option/flag, so this change should be transparent to users.

Offset is a more descriptive noun for this argument. This commit also tweaks
the help message for the argument.

This isn't an option/flag, so this change should be transparent to users.
Copy link
Contributor

@noahmayr noahmayr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@emesterhazy emesterhazy merged commit b07fb3e into main Apr 4, 2024
16 checks passed
@emesterhazy emesterhazy deleted the push-wmwswpnvkqpw branch April 4, 2024 13:32
@PhilipMetzger
Copy link
Contributor

Did you actually want my review? Because this surely could be missunderstood.

@emesterhazy
Copy link
Contributor Author

Sorry, I should have waited longer to submit this. If you have concerns we can always roll back or change it again. What do you think are the issues with "offset"?

@PhilipMetzger
Copy link
Contributor

Offsets usually are 0 based, while the movement (prev/next) is not. It also doesn't make sense if you look at the RevsetExpression::ancestors_at/descendants_at documentation.

@emesterhazy
Copy link
Contributor Author

The movement is zero-based relative something, isn't it? I think what it's relative to depends on where @ currently is and whether --edit is used.

I looked at the revset docs and I don't think "offset" is incompatible. Maybe I'm missing something?

    /// Ancestors of `self`, including `self` until `generation` back.
    pub fn ancestors_at(self: &Rc<RevsetExpression>, generation: u64) -> Rc<RevsetExpression> {
        self.ancestors_range(generation..(generation + 1))
    }

So an offset of 1 is one generation back from the current generation. And an offset of 0 is the current generation. Right?

@PhilipMetzger
Copy link
Contributor

While the name is fine, a offset of one implies the behavior you describe as a bug, so it does not align with the default argument.

@emesterhazy
Copy link
Contributor Author

I have been successfully convinced that the current behavior is not a bug and that I had a misunderstanding about what the movement is relative to (it appears to be relative to @-). Maybe the new name is ok then?

@PhilipMetzger
Copy link
Contributor

Maybe the new name is ok then?

It is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants